import {baseUrl} from './config.js'

export function toplist() {
	return uni.request({
		url: `${baseUrl}/toplist/detail`,
		method: "GET"
	}).then(res => {
		return res.data.list.slice(0, 4);
	})
}

export function list(listId)
{
	return uni.request({
		url:`${baseUrl}/playlist/detail?id=${listId}`,
		method:'GET'
	});
}

export function songDetail(id) {
  return uni.request({
    url: `${config.baseURL}/song/detail?id=${id}`,
    method: 'GET'
  });
}

export function songUrl(id) {
  return uni.request({
    url: `${config.baseURL}/song/url?id=${id}`,
    method: 'GET'
  });
}

export function songLyric(id) {
  return uni.request({
    url: `${config.baseURL}/lyric?id=${id}`,
    method: 'GET'
  });
}